package valueObjects {
	/**
	 * 商品
	 */
	[Bindable]
	public class Product {
		
		public var productId:int; // id
		public var category:Category; // 商品类型
		public var productName:String; // 商品名称
		public var listPrice:Number; // 商品标价
		public var cost:Number; // 商品成本
		public var description:String; // 产品描述
		public var imageName:String; // 图片
	
	    // 构造函数
		public function Product (_category:Category, _productName:String, _unitPrice:Number, _listPrice:Number, _cost:Number, _description:String, _imageName:String) {
			category = _category;
			productName = _productName;
			listPrice = _listPrice;
			cost = _cost;
			description = _description;
			imageName = _imageName;
		}
		
		// 通过一个Object对象创建product
		public static function buildProduct(o:Object):Product {
			var product:Product = new Product(o.category, o.productName, o.listPrice, o.cost, o.description, o.imageName);
			return product;
		}

		public function toString():String {
			return "[Product]"+this.productName;
		}
	}
}
